package arr

// 返回首次value在数组array中被找到的索引值

func IndexOf(a []string, value string) (bool, int) {
	for k, v := range a {
		if v == value {
			return true, k
		}
	}
	return false, 0
}

func IndexOfFloat(a []float64, value float64) (bool, int) {
	for k, v := range a {
		if v == value {
			return true, k
		}
	}
	return false, 0
}

func IndexOfInt(a []int, value int) (bool, int) {
	for k, v := range a {
		if v == value {
			return true, k
		}
	}
	return false, 0
}

func IndexOfInt64(a []int64, value int64) (bool, int) {
	for k, v := range a {
		if v == value {
			return true, k
		}
	}
	return false, 0
}

func IndexOfUInt(a []uint, value uint) (bool, int) {
	for k, v := range a {
		if v == value {
			return true, k
		}
	}
	return false, 0
}

func IndexOfUInt64(a []uint64, value uint64) (bool, int) {
	for k, v := range a {
		if v == value {
			return true, k
		}
	}
	return false, 0
}
